<%@ Page Language="C#" MasterPageFile="~/DefaultMaster.master" AutoEventWireup="true" CodeFile="ViewCart.aspx.cs" Inherits="ViewCart" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderTag" Runat="Server">
   <title>View Cart</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
<h1>Your Shopping Cart</h1>

<form id="CartViewerFrm" runat="server">

<table class="TableWithBorder" border="1" cellspacing="0">

	<asp:Repeater id="rptCartItems" runat="server">	   
		<HeaderTemplate>
		    <tr><td colspan="4" class="ShadedBackgroundTable" style="padding-top: 4px; padding-bottom: 4px;"> &nbsp; Items in Cart:</td></tr>
			<tr>
				<th>Qty</th>
				<th>Product</th>
				<th width="15px">Price</th>
				<td align=center><a href="ViewCart.aspx?EmptyCart=true">[Empty Cart]</a></td>
			</tr>
		</HeaderTemplate>
		<ItemTemplate>
			<tr>
				<td align=center><asp:Label id="lblProductId" runat="server" Visible="False" Text='<%# DataBinder.Eval(Container.DataItem, "ProductId") %>' /><asp:TextBox id="txtQty" runat="server" Width="32px" AutoPostBack="True" Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' OnTextChanged="txtQty_TextChanged" ></asp:TextBox></td>
				<td><%# DataBinder.Eval(Container.DataItem, "ProductName") %></td>
				<td align="right"><%# DataBinder.Eval(Container.DataItem, "Price") %></a></td>
			    <td align=center><a href='ViewCart.aspx?Remove=<%# DataBinder.Eval(Container.DataItem, "ProductId") %>'>[remove]</a></td>
			</tr>
		</ItemTemplate>
		<FooterTemplate>
		    <tr>
		      <td>&nbsp;</td>
		      <td><b>SUBTOTAL:</b></td>
		      <td align="right"><b>  <%=SelectedInvoice.SubTotal.ToString("#.00")%></b></td>
		      <td align=center>
		      </td>
		    </tr>	
		    <tr>
		      <td>&nbsp;</td>
		      <td><i>Shipping:</i></td>
		      <td align="right"><i>  <%=SelectedInvoice.ShippingCost.ToString("#.00")%></i></td>
		      <td align=center>
		      </td>
		    </tr>	
		    <tr>
		      <td>&nbsp;</td>
		      <td><i>Handling:</i></td>
		      <td align="right"><i>  <%=SelectedInvoice.HandlingCost.ToString("#.00")%></i></td>
		      <td align=center>
		      </td>
		    </tr>	
		    <tr>
		      <td>&nbsp;</td>
		      <td><i>Taxes:</i></td>
		      <td align="right"><i>  <%=SelectedInvoice.Taxes.ToString("#.00")%></i></td>
		      <td align=center>
		      </td>
		    </tr>	
		    <tr>
		      <td>&nbsp;</td>
		      <td><b>Total:</b></td>
		      <td align="right"><b>$ <%=SelectedInvoice.Total.ToString("#.00")%></b></td>
		      <td align=center><a href="CheckOut.aspx">[Checkout]</a>
		      </td>
		    </tr>		    		   	 
		</FooterTemplate>
	</asp:Repeater>
	

</table>
    <asp:Label ID="lblEmptyCartMessage" runat="server" Text="There are no items in your shopping cart." Visible="False"></asp:Label></form>

<p>&nbsp;</p>
</asp:Content>

